package com.aaa.service.back.Impl;

import com.aaa.entity.Sales;
import com.aaa.entity.SalesOut;
import com.aaa.entity.SalesOutDetails;
import com.aaa.entity.WarehouseDetails;
import com.aaa.mapper.back.SalesMapper;
import com.aaa.service.back.SalesService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class SalesServiceImpl implements SalesService {

    @Resource
    private SalesMapper salesMapper;


    @Override
    public List<Map<String, Object>> findSales1() {
        return salesMapper.findSales1();
    }

    @Override
    public List<Map<String, Object>> findSales2() {
        return salesMapper.findSales2();
    }

    @Override
    public List<Map<String, Object>> findSales3() {
        return salesMapper.findSales3();
    }

    @Override
    public List<Map<String, Object>> findSalesDetails(String salesId) {
        return salesMapper.findSalesDetails(salesId);
    }

    @Override
    public List<Map<String, Object>> findSalesOutDetails(String salesOutId) {
        return salesMapper.findSalesOutDetails(salesOutId);
    }

    @Override
    public List<SalesOutDetails> findBySalesOutDetails(String salesOutId) {
        return salesMapper.findBySalesOutDetails(salesOutId);
    }

    @Override
    public List<Map<String, Object>> findSalesOut0() {
        return salesMapper.findSalesOut0();
    }

    @Override
    public List<Map<String, Object>> findSalesOut1() {
        return salesMapper.findSalesOut1();
    }

    @Override
    public SalesOut findBySalesOutId(String salesOutId) {
        return salesMapper.findBySalesOutId(salesOutId);
    }

    @Override
    public int editSales3(Sales sales) {
        return salesMapper.editSales3(sales);
    }

    @Override
    public int editSales4(Sales sales) {
        return salesMapper.editSales4(sales);
    }

    @Override
    public int editSalesOut(SalesOut salesOut) {
        return salesMapper.editSalesOut(salesOut);
    }

    @Override
    public int addSalesOut(SalesOut salesOut) {
        return salesMapper.addSalesOut(salesOut);
    }

    @Override
    public int addSalesOutDetails(SalesOutDetails salesOutDetails) {
        return salesMapper.addSalesOutDetails(salesOutDetails);
    }


    @Override
    public int editWarehouseDetails(Integer goodsCount, String goodsId, Integer warehouseId) {
        Map map = new HashMap<String,Object>();
        map.put("goodsCount",goodsCount);
        map.put("goodsId",goodsId);
        map.put("warehouseId",warehouseId);
        return salesMapper.editWarehouseDetails(map);
    }


}
